//
//  NSDate+NBL.m
//  NBLiOSTools
//
//  Created by GangX-yangjh on 2021/12/5.
//

#import "NSDate+NBL.h"

@implementation NSDate (NBL)

- (NSString *)formatDate
{
    return [self formatDateWithFormatString:@"yyyy-MM-dd HH:mm:ss"];
}
- (NSString *)formatDateWithFormatString:(NSString *)format
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    // 转为指定格式
    dateFormatter.dateFormat = format;
    return [dateFormatter stringFromDate:self];
}

@end
